<template>
	<view class="">
		<image :src="url" mode="widthFix" style="width: 70%;margin-top: 200rpx;margin-left: 15%;"></image>
	</view>
</template>

<script>
	import {
		signTimeInfo,
		getSignQrcode
	} from '@/api/index.js'
	export default {
		data() {
			return {
				url:'',
				timeInfo: {},
				showPicker2: false,

				values2: '00:00-00:00',

				showPicker3: false,

				values3: '00:00-00:00',
			}
		},
		onLoad() {
			this.getSignQrcode()
		},
		methods: {
			getSignQrcode(){
				var data = {
				
				}
				getSignQrcode().then(res => {
				this.url=res.data.qrcode_data
				})
			},
			signTimeSet(){
				var data = {
				
				}
				signTimeSet(this.timeInfo).then(res => {
					this.showToast(res.msg)
					this.signTimeInfo()
				})
			},
			signTimeInfo() {
				var data = {

				}
				signTimeInfo(data).then(res => {
					this.timeInfo = res.data
					this.values2 = this.timeInfo.work_start_time_range1 + "-" + this.timeInfo
						.work_start_time_range2
					this.values3 = this.timeInfo.work_end_time_range1 + "-" + this.timeInfo.work_end_time_range2
				})
			},
			pickerCancel2() {

			},
			pickerSure2(result) {
				console.log('---- pickerSure2 ----:', result);
				var list = result.valuesStr1.split("-")
				var e = {
					start_time: list[0],
					end_time: list[1],
				}
				this.timeInfo.work_start_time_range1=e.start_time
				this.timeInfo.work_start_time_range2=e.end_time
				this.values2 = this.timeInfo.work_start_time_range1 + "-" + this.timeInfo
					.work_start_time_range2
				this.values3 = this.timeInfo.work_end_time_range1 + "-" + this.timeInfo.work_end_time_range2
				this.showPicker2=false

			},
			pickerChange2(result) {

			},
			pickerCancel3() {
			
			},
			pickerSure3(result) {
				console.log('---- pickerSure2 ----:', result);
				var list = result.valuesStr1.split("-")
				var e = {
					start_time: list[0],
					end_time: list[1],
				}
				this.timeInfo.work_end_time_range1=e.start_time
				this.timeInfo.work_end_time_range2=e.end_time
				this.values2 = this.timeInfo.work_start_time_range1 + "-" + this.timeInfo
					.work_start_time_range2
				this.values3 = this.timeInfo.work_end_time_range1 + "-" + this.timeInfo.work_end_time_range2
				this.showPicker3=false
			},
			pickerChange3(result) {
			
			},
		}
	}
</script>

<style>
	
</style>